package de.geckocraft.iConomyExchange.main;


import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

import de.geckocraft.iConomyExchange.commands.*;
import de.geckocraft.iConomyExchange.mysql.mysqlconfig;

public class main extends JavaPlugin
{
	public static Plugin plugin;
	
	public void onEnable()
	{
		plugin = this.getServer().getPluginManager().getPlugin(this.getName());
		loadconfig();
		commands();
	}

	public void onDisable()
	{
		
	}

	private void commands()
	{
		getCommand("exchange").setExecutor(new CommandsMain(this));
	}
	
	static public void loadconfig()
	{
		template.loadConfig();
		mysqlconfig.loadConfig();
		configbymysql.loadConfig();
	}
	
	public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
	{
		System.out.println("test");
		return false;
	}
	
	public static Plugin getPlugin()
	{
		Plugin p = plugin;
		return p;
	}
	
	public static boolean parseDouble(String s)
	{
		boolean geht = false;
		
		try{
			Double.parseDouble(s);
			geht = true;
		}catch(Exception e)
		{
			geht = false;
		}
		
		return geht;
	}
	
}
